package com.hainatong.shiphelper.mainhome.adapter;

import org.jetbrains.annotations.NotNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder;
import com.hainatong.shiphelper.R;
import com.hainatong.shiphelper.databinding.ItemWarnMsgViewBinding;
import com.hainatong.shiphelper.mainhome.entity.MsgBean;

public class WarnMsgAdapter extends BaseQuickAdapter<MsgBean, BaseDataBindingHolder<ItemWarnMsgViewBinding>>
{
    public WarnMsgAdapter()
    {
        super(R.layout.item_warn_msg_view);
    }

    @Override
    protected void convert(@NotNull BaseDataBindingHolder<ItemWarnMsgViewBinding> bindingHolder, MsgBean warnMsgBean)
    {
        ItemWarnMsgViewBinding binding = bindingHolder.getDataBinding();
        if( binding != null )
        {
            binding.setWarnMsg( warnMsgBean );
            binding.executePendingBindings();
        }
    }
}
